﻿#pragma once
#include "afxdialogex.h"
#include "CRfidReader.h"

// CCoreOpsDlg 对话框

class CCoreOpsDlg : public CDialogEx
{
	DECLARE_DYNAMIC(CCoreOpsDlg)

public:
	CCoreOpsDlg(CRfidReader* pReader, int& operatorRole, CWnd* pParent = nullptr); // 修改：增加角色引用
	BOOL OnInitDialog();
	virtual ~CCoreOpsDlg();

private:
	//CRfidReader m_reader; // 硬件reader实例
	CRfidReader* m_pReader;//
	int& m_nOperatorRole; // 修改：使用引用以同步主对话框的角色状态
// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_TAB_CORE_OPS };
#endif
protected:
	bool m_isConnected; //用于跟踪连接状态


public:
	CString m_commno;
	afx_msg void OnClickedButtonConnect();
	CComboBox m_comboUidList;
	afx_msg void OnClickedButtonInventory();
	afx_msg void OnCbnSelchangeComboUidList();
	CString m_sFirstBlock;
	CString m_sBlockCount;
//	CString m_sDataRead;
	afx_msg void OnClickedButtonRead();
	void UpdateConnectionState();

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnStnClickedStaticComm();
	CListCtrl m_listDataDisplay;
	afx_msg void OnStnClickedStatic6();
	CString m_sBlockWrite;
	CString m_sDataWrite;
	afx_msg void OnClickedButtonWrite();
	afx_msg void OnBnClickedButtonFormatCard();
};
